<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--<input type="text" id="num1">
<select id="fh">
    <option value="+">+</option>
    <option value="-">-</option>
    <option value="*">*</option>
    <option value="/">/</option>
</select>
<input type="text" id="num2">
<input type="button" value="=" id="jg">
<p id="count"></p>-->
<input type="number">
<script>
    /* var a=123;
     var b=a+"a1";
     var c=Number(b);//数据类型转换

     console.log("1"==false);
     console.log("1"===true);
     function f(a,d) {//可以传值不传值就是undefined
         console.log(a);
         if(a>0){
             console.log("大于零");
         }else if(d>-2) {
             console.log("大于二");
         }else {
             console.log("小于零");

         }
     }
     f(0,-1);
    document.getElementById("jg").onclick = function () {
        var num1 = document.getElementById("num1").value;
        var num2 = document.getElementById("num2").value;
        var fh = document.getElementById("fh").value;
       var n1 = parseInt(num1);
       var n2= parseInt(num2);

        var j=andf(n1,n2,fh);
        document.getElementById("count").innerHTML=j;

    }
   var andf= function(x,y,j) {
        var con=0;
        switch (j) {
            case "+":
                return  x+y;
                break;
            case "-":
                return x-y;
                break;
            case "*":
                return   x*y;
                break;
            case "/":
                con=x/y;
                break;
        }
        return con;
    }
     var a=1;
     function f() {
        var b=2+a;
        return b;
     }
     f();
     console.log(f())
    var a=new Array();
    var b="[1,2]";
    console.log(Array.isArray(b));//检测数组。。*/

    //栈
    var color=['red','yellow','green'];
    var c="red";
    var d="green";
    var points = [40,100,1,5,25,10];

    console.log(points.sort(function(a,b){return a-b}));
    // var h=color.entries()
    

    //console.log(c.forEach(f));
    // function f(item,index) {
    //     console.log(index,item);
    // }

    // var a=color.join("|");//分割字符串
    // console.log(a.toString());
    
    //push()推
    // color.push("block");
    // console.log(color);
    //pop()删除
    // color.pop();
    // console.log(color);
    //队列fido,先进先出shift()
    // color.unshift("hahah");
    // color.shift();
    // console.log(color);
    // console.log(color.valueOf());





</script>
</body>
</html>